<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/01/27
 * Time: 上午 10:22
 */

namespace app\admin\controller;


use think\Exception;

/**
 * Class Update
 * @package app\admin\controller
 * 关于我们
 */
class Update extends Common
{
    /**
     * @Desc 更新管理
     * @return \think\response\View
     */
    public function index()
    {
        $update = db("Sysmsg_about")
            ->where("is_about",2)
            ->find();
        return view("",['update'=>$update]);
    }

    /**
     * @Desc 修改更新信息
     * @return \think\response\Json
     */
    public function edit()
    {
        $data = input('post.');
        try {
            $sysabout = new \app\admin\model\Sysmsgabout();
            $sysabout->doModifyUpdate($data);
        } catch (Exception $e) {
            return json([
                'statusCode' => 300,
                'message' => $e->getMessage(),
            ]);
        }
        return json([
            'statusCode' => 200,
            'message' => '修改成功',
            'navTabId' => 'UpdateManage',
            'callbackType' => 'closeCurrent',
        ]);
    }
}